<?php
declare (strict_types=1);

namespace app\model;

use think\Model;

class Departments extends Model {
    // 设置表名
    protected $name = 'departments';

    // 设置主键
    protected $pk = 'department_id';

    // 定义与员工的关联关系
    public function employees() {
        return $this->hasMany(Employees::class, 'department_id', 'department_id');
    }
} 